<template>
  <view class="content">
    <view class="header">
      <image class="logo" src="@/static/logo.png"></image>
      <text class="title">弘禾移动办公平台</text>
    </view>
    
    <view class="card-section">
      <view class="section-title">快捷入口</view>
      <view class="quick-links">
        <view class="quick-item" @click="navigateTo('/pages/work/index')">
          <uni-icons type="bars" size="30" color="#1296db"></uni-icons>
          <text>工作台</text>
        </view>
        <view class="quick-item" @click="navigateTo('/pages/system/user/index')">
          <uni-icons type="personadd" size="30" color="#13ce66"></uni-icons>
          <text>用户管理</text>
        </view>
        <view class="quick-item" @click="navigateTo('/pages/system/notice/index')">
          <uni-icons type="notification" size="30" color="#ff9900"></uni-icons>
          <text>通知公告</text>
        </view>
        <view class="quick-item" @click="navigateTo('/pages/mine/index')">
          <uni-icons type="person" size="30" color="#ff5a5a"></uni-icons>
          <text>个人中心</text>
        </view>
      </view>
    </view>
    
    <view class="card-section">
      <view class="section-title">待办事项</view>
      <view class="todo-list">
        <view class="empty-tip" v-if="todoList.length === 0">
          <text>暂无待办事项</text>
        </view>
        <view class="todo-item" v-for="(item, index) in todoList" :key="index" @click="handleTodoItem(item)">
          <view class="todo-content">
            <text class="todo-title">{{item.title}}</text>
            <text class="todo-time">{{item.time}}</text>
          </view>
          <uni-icons type="right" size="20" color="#bbb"></uni-icons>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      todoList: [
        {
          id: 1,
          title: '系统演示待办项目',
          time: '2025-05-06 10:30'
        },
        {
          id: 2,
          title: '弘禾项目对接工作',
          time: '2025-05-07 14:00'
        }
      ]
    }
  },
  methods: {
    navigateTo(url) {
      uni.navigateTo({
        url: url
      });
    },
    handleTodoItem(item) {
      this.$modal.showToast('待办功能对接中');
    }
  }
}
</script>

<style lang="scss" scoped>
.content {
  padding: 20px;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  margin-top: 40px;
  
  .logo {
    height: 80px;
    width: 80px;
    margin-bottom: 15px;
  }
  
  .title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
  }
}

.card-section {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  
  .section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    position: relative;
    padding-left: 12px;
    
    &:before {
      content: '';
      position: absolute;
      left: 0;
      top: 4px;
      height: 16px;
      width: 4px;
      background-color: #1296db;
      border-radius: 2px;
    }
  }
}

.quick-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  
  .quick-item {
    width: 22%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    
    text {
      margin-top: 8px;
      font-size: 14px;
      color: #666;
    }
  }
}

.todo-list {
  .empty-tip {
    text-align: center;
    padding: 20px 0;
    color: #999;
  }
  
  .todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    
    &:last-child {
      border-bottom: none;
    }
    
    .todo-content {
      display: flex;
      flex-direction: column;
      
      .todo-title {
        font-size: 15px;
        color: #333;
        margin-bottom: 5px;
      }
      
      .todo-time {
        font-size: 12px;
        color: #999;
      }
    }
  }
}
</style>
